<?php include_once "usuariosinfo.php" ?>
<?php

// Create page object
if (!isset($subtipodetalles_grid)) $subtipodetalles_grid = new csubtipodetalles_grid();

// Page init
$subtipodetalles_grid->Page_Init();

// Page main
$subtipodetalles_grid->Page_Main();

// Global Page Rendering event (in userfn*.php)
Page_Rendering();

// Page Rendering event
$subtipodetalles_grid->Page_Render();
?>
<?php if ($subtipodetalles->Export == "") { ?>
<script type="text/javascript">

// Page object
var subtipodetalles_grid = new ew_Page("subtipodetalles_grid");
subtipodetalles_grid.PageID = "grid"; // Page ID
var EW_PAGE_ID = subtipodetalles_grid.PageID; // For backward compatibility

// Form object
var fsubtipodetallesgrid = new ew_Form("fsubtipodetallesgrid");
fsubtipodetallesgrid.FormKeyCountName = '<?php echo $subtipodetalles_grid->FormKeyCountName ?>';

// Validate form
fsubtipodetallesgrid.Validate = function() {
	if (!this.ValidateRequired)
		return true; // Ignore validation
	var $ = jQuery, fobj = this.GetForm(), $fobj = $(fobj);
	this.PostAutoSuggest();
	if ($fobj.find("#a_confirm").val() == "F")
		return true;
	var elm, felm, uelm, addcnt = 0;
	var $k = $fobj.find("#" + this.FormKeyCountName); // Get key_count
	var rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1;
	var startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
	var gridinsert = $fobj.find("#a_list").val() == "gridinsert";
	for (var i = startcnt; i <= rowcnt; i++) {
		var infix = ($k[0]) ? String(i) : "";
		$fobj.data("rowindex", infix);
		var checkrow = (gridinsert) ? !this.EmptyRow(infix) : true;
		if (checkrow) {
			addcnt++;
			elm = this.GetElements("x" + infix + "_SubtTipoDetalleTipo");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($subtipodetalles->SubtTipoDetalleTipo->FldErrMsg()) ?>");

			// Set up row object
			ew_ElementsToRow(fobj);

			// Fire Form_CustomValidate event
			if (!this.Form_CustomValidate(fobj))
				return false;
		} // End Grid Add checking
	}
	return true;
}

// Check empty row
fsubtipodetallesgrid.EmptyRow = function(infix) {
	var fobj = this.Form;
	if (ew_ValueChanged(fobj, infix, "SubtTipoDetalleTipo", false)) return false;
	if (ew_ValueChanged(fobj, infix, "SubTipoNombre", false)) return false;
	if (ew_ValueChanged(fobj, infix, "SubTipoUrl", false)) return false;
	return true;
}

// Form_CustomValidate event
fsubtipodetallesgrid.Form_CustomValidate = 
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }

// Use JavaScript validation or not
<?php if (EW_CLIENT_VALIDATE) { ?>
fsubtipodetallesgrid.ValidateRequired = true;
<?php } else { ?>
fsubtipodetallesgrid.ValidateRequired = false; 
<?php } ?>

// Dynamic selection lists
// Form object for search

</script>
<?php } ?>
<?php if ($subtipodetalles->getCurrentMasterTable() == "" && $subtipodetalles_grid->ExportOptions->Visible()) { ?>
<div class="ewListExportOptions"><?php $subtipodetalles_grid->ExportOptions->Render("body") ?></div>
<?php } ?>
<?php
if ($subtipodetalles->CurrentAction == "gridadd") {
	if ($subtipodetalles->CurrentMode == "copy") {
		$bSelectLimit = EW_SELECT_LIMIT;
		if ($bSelectLimit) {
			$subtipodetalles_grid->TotalRecs = $subtipodetalles->SelectRecordCount();
			$subtipodetalles_grid->Recordset = $subtipodetalles_grid->LoadRecordset($subtipodetalles_grid->StartRec-1, $subtipodetalles_grid->DisplayRecs);
		} else {
			if ($subtipodetalles_grid->Recordset = $subtipodetalles_grid->LoadRecordset())
				$subtipodetalles_grid->TotalRecs = $subtipodetalles_grid->Recordset->RecordCount();
		}
		$subtipodetalles_grid->StartRec = 1;
		$subtipodetalles_grid->DisplayRecs = $subtipodetalles_grid->TotalRecs;
	} else {
		$subtipodetalles->CurrentFilter = "0=1";
		$subtipodetalles_grid->StartRec = 1;
		$subtipodetalles_grid->DisplayRecs = $subtipodetalles->GridAddRowCount;
	}
	$subtipodetalles_grid->TotalRecs = $subtipodetalles_grid->DisplayRecs;
	$subtipodetalles_grid->StopRec = $subtipodetalles_grid->DisplayRecs;
} else {
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$subtipodetalles_grid->TotalRecs = $subtipodetalles->SelectRecordCount();
	} else {
		if ($subtipodetalles_grid->Recordset = $subtipodetalles_grid->LoadRecordset())
			$subtipodetalles_grid->TotalRecs = $subtipodetalles_grid->Recordset->RecordCount();
	}
	$subtipodetalles_grid->StartRec = 1;
	$subtipodetalles_grid->DisplayRecs = $subtipodetalles_grid->TotalRecs; // Display all records
	if ($bSelectLimit)
		$subtipodetalles_grid->Recordset = $subtipodetalles_grid->LoadRecordset($subtipodetalles_grid->StartRec-1, $subtipodetalles_grid->DisplayRecs);
}
$subtipodetalles_grid->RenderOtherOptions();
?>
<?php $subtipodetalles_grid->ShowPageHeader(); ?>
<?php
$subtipodetalles_grid->ShowMessage();
?>
<table class="ewGrid"><tr><td class="ewGridContent">
<div id="fsubtipodetallesgrid" class="ewForm form-inline">
<div id="gmp_subtipodetalles" class="ewGridMiddlePanel">
<table id="tbl_subtipodetallesgrid" class="ewTable ewTableSeparate">
<?php echo $subtipodetalles->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

// Render list options
$subtipodetalles_grid->RenderListOptions();

// Render list options (header, left)
$subtipodetalles_grid->ListOptions->Render("header", "left");
?>
<?php if ($subtipodetalles->SubTipoDetalleId->Visible) { // SubTipoDetalleId ?>
	<?php if ($subtipodetalles->SortUrl($subtipodetalles->SubTipoDetalleId) == "") { ?>
		<td><div id="elh_subtipodetalles_SubTipoDetalleId" class="subtipodetalles_SubTipoDetalleId"><div class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubTipoDetalleId->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_subtipodetalles_SubTipoDetalleId" class="subtipodetalles_SubTipoDetalleId">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubTipoDetalleId->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($subtipodetalles->SubTipoDetalleId->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($subtipodetalles->SubTipoDetalleId->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($subtipodetalles->SubtTipoDetalleTipo->Visible) { // SubtTipoDetalleTipo ?>
	<?php if ($subtipodetalles->SortUrl($subtipodetalles->SubtTipoDetalleTipo) == "") { ?>
		<td><div id="elh_subtipodetalles_SubtTipoDetalleTipo" class="subtipodetalles_SubtTipoDetalleTipo"><div class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubtTipoDetalleTipo->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_subtipodetalles_SubtTipoDetalleTipo" class="subtipodetalles_SubtTipoDetalleTipo">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubtTipoDetalleTipo->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($subtipodetalles->SubtTipoDetalleTipo->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($subtipodetalles->SubtTipoDetalleTipo->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($subtipodetalles->SubTipoNombre->Visible) { // SubTipoNombre ?>
	<?php if ($subtipodetalles->SortUrl($subtipodetalles->SubTipoNombre) == "") { ?>
		<td><div id="elh_subtipodetalles_SubTipoNombre" class="subtipodetalles_SubTipoNombre"><div class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubTipoNombre->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_subtipodetalles_SubTipoNombre" class="subtipodetalles_SubTipoNombre">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubTipoNombre->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($subtipodetalles->SubTipoNombre->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($subtipodetalles->SubTipoNombre->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($subtipodetalles->SubTipoUrl->Visible) { // SubTipoUrl ?>
	<?php if ($subtipodetalles->SortUrl($subtipodetalles->SubTipoUrl) == "") { ?>
		<td><div id="elh_subtipodetalles_SubTipoUrl" class="subtipodetalles_SubTipoUrl"><div class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubTipoUrl->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_subtipodetalles_SubTipoUrl" class="subtipodetalles_SubTipoUrl">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $subtipodetalles->SubTipoUrl->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($subtipodetalles->SubTipoUrl->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($subtipodetalles->SubTipoUrl->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php

// Render list options (header, right)
$subtipodetalles_grid->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
$subtipodetalles_grid->StartRec = 1;
$subtipodetalles_grid->StopRec = $subtipodetalles_grid->TotalRecs; // Show all records

// Restore number of post back records
if ($objForm) {
	$objForm->Index = -1;
	if ($objForm->HasValue($subtipodetalles_grid->FormKeyCountName) && ($subtipodetalles->CurrentAction == "gridadd" || $subtipodetalles->CurrentAction == "gridedit" || $subtipodetalles->CurrentAction == "F")) {
		$subtipodetalles_grid->KeyCount = $objForm->GetValue($subtipodetalles_grid->FormKeyCountName);
		$subtipodetalles_grid->StopRec = $subtipodetalles_grid->StartRec + $subtipodetalles_grid->KeyCount - 1;
	}
}
$subtipodetalles_grid->RecCnt = $subtipodetalles_grid->StartRec - 1;
if ($subtipodetalles_grid->Recordset && !$subtipodetalles_grid->Recordset->EOF) {
	$subtipodetalles_grid->Recordset->MoveFirst();
	if (!$bSelectLimit && $subtipodetalles_grid->StartRec > 1)
		$subtipodetalles_grid->Recordset->Move($subtipodetalles_grid->StartRec - 1);
} elseif (!$subtipodetalles->AllowAddDeleteRow && $subtipodetalles_grid->StopRec == 0) {
	$subtipodetalles_grid->StopRec = $subtipodetalles->GridAddRowCount;
}

// Initialize aggregate
$subtipodetalles->RowType = EW_ROWTYPE_AGGREGATEINIT;
$subtipodetalles->ResetAttrs();
$subtipodetalles_grid->RenderRow();
if ($subtipodetalles->CurrentAction == "gridadd")
	$subtipodetalles_grid->RowIndex = 0;
if ($subtipodetalles->CurrentAction == "gridedit")
	$subtipodetalles_grid->RowIndex = 0;
while ($subtipodetalles_grid->RecCnt < $subtipodetalles_grid->StopRec) {
	$subtipodetalles_grid->RecCnt++;
	if (intval($subtipodetalles_grid->RecCnt) >= intval($subtipodetalles_grid->StartRec)) {
		$subtipodetalles_grid->RowCnt++;
		if ($subtipodetalles->CurrentAction == "gridadd" || $subtipodetalles->CurrentAction == "gridedit" || $subtipodetalles->CurrentAction == "F") {
			$subtipodetalles_grid->RowIndex++;
			$objForm->Index = $subtipodetalles_grid->RowIndex;
			if ($objForm->HasValue($subtipodetalles_grid->FormActionName))
				$subtipodetalles_grid->RowAction = strval($objForm->GetValue($subtipodetalles_grid->FormActionName));
			elseif ($subtipodetalles->CurrentAction == "gridadd")
				$subtipodetalles_grid->RowAction = "insert";
			else
				$subtipodetalles_grid->RowAction = "";
		}

		// Set up key count
		$subtipodetalles_grid->KeyCount = $subtipodetalles_grid->RowIndex;

		// Init row class and style
		$subtipodetalles->ResetAttrs();
		$subtipodetalles->CssClass = "";
		if ($subtipodetalles->CurrentAction == "gridadd") {
			if ($subtipodetalles->CurrentMode == "copy") {
				$subtipodetalles_grid->LoadRowValues($subtipodetalles_grid->Recordset); // Load row values
				$subtipodetalles_grid->SetRecordKey($subtipodetalles_grid->RowOldKey, $subtipodetalles_grid->Recordset); // Set old record key
			} else {
				$subtipodetalles_grid->LoadDefaultValues(); // Load default values
				$subtipodetalles_grid->RowOldKey = ""; // Clear old key value
			}
		} else {
			$subtipodetalles_grid->LoadRowValues($subtipodetalles_grid->Recordset); // Load row values
		}
		$subtipodetalles->RowType = EW_ROWTYPE_VIEW; // Render view
		if ($subtipodetalles->CurrentAction == "gridadd") // Grid add
			$subtipodetalles->RowType = EW_ROWTYPE_ADD; // Render add
		if ($subtipodetalles->CurrentAction == "gridadd" && $subtipodetalles->EventCancelled && !$objForm->HasValue("k_blankrow")) // Insert failed
			$subtipodetalles_grid->RestoreCurrentRowFormValues($subtipodetalles_grid->RowIndex); // Restore form values
		if ($subtipodetalles->CurrentAction == "gridedit") { // Grid edit
			if ($subtipodetalles->EventCancelled) {
				$subtipodetalles_grid->RestoreCurrentRowFormValues($subtipodetalles_grid->RowIndex); // Restore form values
			}
			if ($subtipodetalles_grid->RowAction == "insert")
				$subtipodetalles->RowType = EW_ROWTYPE_ADD; // Render add
			else
				$subtipodetalles->RowType = EW_ROWTYPE_EDIT; // Render edit
		}
		if ($subtipodetalles->CurrentAction == "gridedit" && ($subtipodetalles->RowType == EW_ROWTYPE_EDIT || $subtipodetalles->RowType == EW_ROWTYPE_ADD) && $subtipodetalles->EventCancelled) // Update failed
			$subtipodetalles_grid->RestoreCurrentRowFormValues($subtipodetalles_grid->RowIndex); // Restore form values
		if ($subtipodetalles->RowType == EW_ROWTYPE_EDIT) // Edit row
			$subtipodetalles_grid->EditRowCnt++;
		if ($subtipodetalles->CurrentAction == "F") // Confirm row
			$subtipodetalles_grid->RestoreCurrentRowFormValues($subtipodetalles_grid->RowIndex); // Restore form values

		// Set up row id / data-rowindex
		$subtipodetalles->RowAttrs = array_merge($subtipodetalles->RowAttrs, array('data-rowindex'=>$subtipodetalles_grid->RowCnt, 'id'=>'r' . $subtipodetalles_grid->RowCnt . '_subtipodetalles', 'data-rowtype'=>$subtipodetalles->RowType));

		// Render row
		$subtipodetalles_grid->RenderRow();

		// Render list options
		$subtipodetalles_grid->RenderListOptions();

		// Skip delete row / empty row for confirm page
		if ($subtipodetalles_grid->RowAction <> "delete" && $subtipodetalles_grid->RowAction <> "insertdelete" && !($subtipodetalles_grid->RowAction == "insert" && $subtipodetalles->CurrentAction == "F" && $subtipodetalles_grid->EmptyRow())) {
?>
	<tr<?php echo $subtipodetalles->RowAttributes() ?>>
<?php

// Render list options (body, left)
$subtipodetalles_grid->ListOptions->Render("body", "left", $subtipodetalles_grid->RowCnt);
?>
	<?php if ($subtipodetalles->SubTipoDetalleId->Visible) { // SubTipoDetalleId ?>
		<td<?php echo $subtipodetalles->SubTipoDetalleId->CellAttributes() ?>>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="hidden" data-field="x_SubTipoDetalleId" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoDetalleId->OldValue) ?>">
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $subtipodetalles_grid->RowCnt ?>_subtipodetalles_SubTipoDetalleId" class="control-group subtipodetalles_SubTipoDetalleId">
<span<?php echo $subtipodetalles->SubTipoDetalleId->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubTipoDetalleId->EditValue ?></span>
</span>
<input type="hidden" data-field="x_SubTipoDetalleId" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoDetalleId->CurrentValue) ?>">
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $subtipodetalles->SubTipoDetalleId->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubTipoDetalleId->ListViewValue() ?></span>
<input type="hidden" data-field="x_SubTipoDetalleId" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoDetalleId->FormValue) ?>">
<input type="hidden" data-field="x_SubTipoDetalleId" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoDetalleId->OldValue) ?>">
<?php } ?>
<a id="<?php echo $subtipodetalles_grid->PageObjName . "_row_" . $subtipodetalles_grid->RowCnt ?>"></a></td>
	<?php } ?>
	<?php if ($subtipodetalles->SubtTipoDetalleTipo->Visible) { // SubtTipoDetalleTipo ?>
		<td<?php echo $subtipodetalles->SubtTipoDetalleTipo->CellAttributes() ?>>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<?php if ($subtipodetalles->SubtTipoDetalleTipo->getSessionValue() <> "") { ?>
<span<?php echo $subtipodetalles->SubtTipoDetalleTipo->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubtTipoDetalleTipo->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->CurrentValue) ?>">
<?php } else { ?>
<input type="text" data-field="x_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" size="30" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubtTipoDetalleTipo->EditValue ?>"<?php echo $subtipodetalles->SubtTipoDetalleTipo->EditAttributes() ?>>
<?php } ?>
<input type="hidden" data-field="x_SubtTipoDetalleTipo" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->OldValue) ?>">
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<?php if ($subtipodetalles->SubtTipoDetalleTipo->getSessionValue() <> "") { ?>
<span<?php echo $subtipodetalles->SubtTipoDetalleTipo->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubtTipoDetalleTipo->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->CurrentValue) ?>">
<?php } else { ?>
<input type="text" data-field="x_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" size="30" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubtTipoDetalleTipo->EditValue ?>"<?php echo $subtipodetalles->SubtTipoDetalleTipo->EditAttributes() ?>>
<?php } ?>
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $subtipodetalles->SubtTipoDetalleTipo->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubtTipoDetalleTipo->ListViewValue() ?></span>
<input type="hidden" data-field="x_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->FormValue) ?>">
<input type="hidden" data-field="x_SubtTipoDetalleTipo" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($subtipodetalles->SubTipoNombre->Visible) { // SubTipoNombre ?>
		<td<?php echo $subtipodetalles->SubTipoNombre->CellAttributes() ?>>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $subtipodetalles_grid->RowCnt ?>_subtipodetalles_SubTipoNombre" class="control-group subtipodetalles_SubTipoNombre">
<input type="text" data-field="x_SubTipoNombre" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" size="30" maxlength="50" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubTipoNombre->EditValue ?>"<?php echo $subtipodetalles->SubTipoNombre->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_SubTipoNombre" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->OldValue) ?>">
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $subtipodetalles_grid->RowCnt ?>_subtipodetalles_SubTipoNombre" class="control-group subtipodetalles_SubTipoNombre">
<input type="text" data-field="x_SubTipoNombre" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" size="30" maxlength="50" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubTipoNombre->EditValue ?>"<?php echo $subtipodetalles->SubTipoNombre->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $subtipodetalles->SubTipoNombre->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubTipoNombre->ListViewValue() ?></span>
<input type="hidden" data-field="x_SubTipoNombre" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->FormValue) ?>">
<input type="hidden" data-field="x_SubTipoNombre" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($subtipodetalles->SubTipoUrl->Visible) { // SubTipoUrl ?>
		<td<?php echo $subtipodetalles->SubTipoUrl->CellAttributes() ?>>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $subtipodetalles_grid->RowCnt ?>_subtipodetalles_SubTipoUrl" class="control-group subtipodetalles_SubTipoUrl">
<input type="text" data-field="x_SubTipoUrl" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" size="30" maxlength="190" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubTipoUrl->EditValue ?>"<?php echo $subtipodetalles->SubTipoUrl->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_SubTipoUrl" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->OldValue) ?>">
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $subtipodetalles_grid->RowCnt ?>_subtipodetalles_SubTipoUrl" class="control-group subtipodetalles_SubTipoUrl">
<input type="text" data-field="x_SubTipoUrl" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" size="30" maxlength="190" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubTipoUrl->EditValue ?>"<?php echo $subtipodetalles->SubTipoUrl->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $subtipodetalles->SubTipoUrl->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubTipoUrl->ListViewValue() ?></span>
<input type="hidden" data-field="x_SubTipoUrl" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->FormValue) ?>">
<input type="hidden" data-field="x_SubTipoUrl" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$subtipodetalles_grid->ListOptions->Render("body", "right", $subtipodetalles_grid->RowCnt);
?>
	</tr>
<?php if ($subtipodetalles->RowType == EW_ROWTYPE_ADD || $subtipodetalles->RowType == EW_ROWTYPE_EDIT) { ?>
<script type="text/javascript">
fsubtipodetallesgrid.UpdateOpts(<?php echo $subtipodetalles_grid->RowIndex ?>);
</script>
<?php } ?>
<?php
	}
	} // End delete row checking
	if ($subtipodetalles->CurrentAction <> "gridadd" || $subtipodetalles->CurrentMode == "copy")
		if (!$subtipodetalles_grid->Recordset->EOF) $subtipodetalles_grid->Recordset->MoveNext();
}
?>
<?php
	if ($subtipodetalles->CurrentMode == "add" || $subtipodetalles->CurrentMode == "copy" || $subtipodetalles->CurrentMode == "edit") {
		$subtipodetalles_grid->RowIndex = '$rowindex$';
		$subtipodetalles_grid->LoadDefaultValues();

		// Set row properties
		$subtipodetalles->ResetAttrs();
		$subtipodetalles->RowAttrs = array_merge($subtipodetalles->RowAttrs, array('data-rowindex'=>$subtipodetalles_grid->RowIndex, 'id'=>'r0_subtipodetalles', 'data-rowtype'=>EW_ROWTYPE_ADD));
		ew_AppendClass($subtipodetalles->RowAttrs["class"], "ewTemplate");
		$subtipodetalles->RowType = EW_ROWTYPE_ADD;

		// Render row
		$subtipodetalles_grid->RenderRow();

		// Render list options
		$subtipodetalles_grid->RenderListOptions();
		$subtipodetalles_grid->StartRowCnt = 0;
?>
	<tr<?php echo $subtipodetalles->RowAttributes() ?>>
<?php

// Render list options (body, left)
$subtipodetalles_grid->ListOptions->Render("body", "left", $subtipodetalles_grid->RowIndex);
?>
	<?php if ($subtipodetalles->SubTipoDetalleId->Visible) { // SubTipoDetalleId ?>
		<td>
<?php if ($subtipodetalles->CurrentAction <> "F") { ?>
<?php } else { ?>
<span id="el$rowindex$_subtipodetalles_SubTipoDetalleId" class="control-group subtipodetalles_SubTipoDetalleId">
<span<?php echo $subtipodetalles->SubTipoDetalleId->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubTipoDetalleId->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_SubTipoDetalleId" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoDetalleId->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_SubTipoDetalleId" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoDetalleId" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoDetalleId->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($subtipodetalles->SubtTipoDetalleTipo->Visible) { // SubtTipoDetalleTipo ?>
		<td>
<?php if ($subtipodetalles->CurrentAction <> "F") { ?>
<?php if ($subtipodetalles->SubtTipoDetalleTipo->getSessionValue() <> "") { ?>
<span<?php echo $subtipodetalles->SubtTipoDetalleTipo->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubtTipoDetalleTipo->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->CurrentValue) ?>">
<?php } else { ?>
<input type="text" data-field="x_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" size="30" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubtTipoDetalleTipo->EditValue ?>"<?php echo $subtipodetalles->SubtTipoDetalleTipo->EditAttributes() ?>>
<?php } ?>
<?php } else { ?>
<span<?php echo $subtipodetalles->SubtTipoDetalleTipo->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubtTipoDetalleTipo->ViewValue ?></span>
<input type="hidden" data-field="x_SubtTipoDetalleTipo" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_SubtTipoDetalleTipo" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubtTipoDetalleTipo" value="<?php echo ew_HtmlEncode($subtipodetalles->SubtTipoDetalleTipo->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($subtipodetalles->SubTipoNombre->Visible) { // SubTipoNombre ?>
		<td>
<?php if ($subtipodetalles->CurrentAction <> "F") { ?>
<span id="el$rowindex$_subtipodetalles_SubTipoNombre" class="control-group subtipodetalles_SubTipoNombre">
<input type="text" data-field="x_SubTipoNombre" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" size="30" maxlength="50" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubTipoNombre->EditValue ?>"<?php echo $subtipodetalles->SubTipoNombre->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_subtipodetalles_SubTipoNombre" class="control-group subtipodetalles_SubTipoNombre">
<span<?php echo $subtipodetalles->SubTipoNombre->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubTipoNombre->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_SubTipoNombre" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_SubTipoNombre" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoNombre" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoNombre->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($subtipodetalles->SubTipoUrl->Visible) { // SubTipoUrl ?>
		<td>
<?php if ($subtipodetalles->CurrentAction <> "F") { ?>
<span id="el$rowindex$_subtipodetalles_SubTipoUrl" class="control-group subtipodetalles_SubTipoUrl">
<input type="text" data-field="x_SubTipoUrl" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" size="30" maxlength="190" placeholder="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->PlaceHolder) ?>" value="<?php echo $subtipodetalles->SubTipoUrl->EditValue ?>"<?php echo $subtipodetalles->SubTipoUrl->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_subtipodetalles_SubTipoUrl" class="control-group subtipodetalles_SubTipoUrl">
<span<?php echo $subtipodetalles->SubTipoUrl->ViewAttributes() ?>>
<?php echo $subtipodetalles->SubTipoUrl->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_SubTipoUrl" name="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="x<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_SubTipoUrl" name="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" id="o<?php echo $subtipodetalles_grid->RowIndex ?>_SubTipoUrl" value="<?php echo ew_HtmlEncode($subtipodetalles->SubTipoUrl->OldValue) ?>">
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$subtipodetalles_grid->ListOptions->Render("body", "right", $subtipodetalles_grid->RowCnt);
?>
<script type="text/javascript">
fsubtipodetallesgrid.UpdateOpts(<?php echo $subtipodetalles_grid->RowIndex ?>);
</script>
	</tr>
<?php
}
?>
</tbody>
</table>
<?php if ($subtipodetalles->CurrentMode == "add" || $subtipodetalles->CurrentMode == "copy") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridinsert">
<input type="hidden" name="<?php echo $subtipodetalles_grid->FormKeyCountName ?>" id="<?php echo $subtipodetalles_grid->FormKeyCountName ?>" value="<?php echo $subtipodetalles_grid->KeyCount ?>">
<?php echo $subtipodetalles_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($subtipodetalles->CurrentMode == "edit") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridupdate">
<input type="hidden" name="<?php echo $subtipodetalles_grid->FormKeyCountName ?>" id="<?php echo $subtipodetalles_grid->FormKeyCountName ?>" value="<?php echo $subtipodetalles_grid->KeyCount ?>">
<?php echo $subtipodetalles_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($subtipodetalles->CurrentMode == "") { ?>
<input type="hidden" name="a_list" id="a_list" value="">
<?php } ?>
<input type="hidden" name="detailpage" value="fsubtipodetallesgrid">
</div>
<?php

// Close recordset
if ($subtipodetalles_grid->Recordset)
	$subtipodetalles_grid->Recordset->Close();
?>
<?php if ($subtipodetalles_grid->ShowOtherOptions) { ?>
<div class="ewGridLowerPanel ewListOtherOptions">
<?php
	foreach ($subtipodetalles_grid->OtherOptions as &$option)
		$option->Render("body", "bottom");
?>
</div>
<?php } ?>
</div>
</td></tr></table>
<?php if ($subtipodetalles->Export == "") { ?>
<script type="text/javascript">
fsubtipodetallesgrid.Init();
<?php if (EW_MOBILE_REFLOW && ew_IsMobile()) { ?>
ew_Reflow();
<?php } ?>
</script>
<?php } ?>
<?php
$subtipodetalles_grid->ShowPageFooter();
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
?>
<?php
$subtipodetalles_grid->Page_Terminate();
?>
